/*
package xrc.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

*/
/**
 * RabbitMQ配置类-Direct模式
 * 交换机与队列绑定时 需要添加路由key 并且在发消息时也需要有路由key
 * 根据发送消息时携带的路由key 与一开始交换机与队列绑定时的路由key进行匹配
 * 匹配成功就会直接发送消息
 * 匹配默认情况为 消息丢失
 *//*


@Configuration
public class RabbitMQDirectConfig {

    private static final String QUEUE01 = "queue_direct01";
    private static final String QUEUE02 = "queue_direct02";
    private static final String EXCHANGE = "directExchange";
    private static final String ROUTING_KEY01 = "queue.red";
    private static final String ROUTING_KEY02 = "queue.green";

    @Bean
    public Queue queue01() {
        return new Queue(QUEUE01);
    }

    @Bean
    public Queue queue02() {
        return new Queue(QUEUE02);
    }

    @Bean
    public DirectExchange exchange() {
        return new DirectExchange(EXCHANGE);
    }

    @Bean
    public Binding binding01() {
        return BindingBuilder.bind(queue01()).to(exchange()).with(ROUTING_KEY01);
    }

    @Bean
    public Binding binding02() {
        return BindingBuilder.bind(queue02()).to(exchange()).with(ROUTING_KEY02);
    }
}
*/
